<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>消息模版</title>
	<meta name="decorator" content="default" />
	<script type="text/javascript">
        $(function(){
            $("td").css("vertical-align","middle");
        })
        $(document).ready(function() {
            $("tr").click(function(){
                $(this).find("input[type='radio']").attr("checked",true);
            })
        });
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
	</script>
</head>
<body>
<form:form id="searchForm" modelAttribute="messageTemplate"
		   action="${ctx}/business/messagetemplate/select" method="post" class="breadcrumb form-search">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
	<input id="pageSize" name="pageSize" type="hidden"
		   value="${page.pageSize}" />
	<label>名称  ：</label>
	<form:input path="name" htmlEscape="false" maxlength="50"
				class="input-medium" />
	&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit"
	value="查询" />
</form:form>
<tags:message content="${message}" />
<div style="overflow-x:scroll;">
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
		<th>选择</th>
		<th>ID</th>
		<th>模板名称</th>
		<th>类型</th>
		<th>微信模板ID</th>
		<th>模板内容</th>
		<th>接收人</th>
		<th>地区</th>
		<th>状态</th>
		<th>可编辑</th>
		<th>备注</th>
	</tr>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="messageTemplate">
		<tr>
			<td><input id="key" name="id" value="${messageTemplate.id}" text="${messageTemplate.name}"
					     editable="${messageTemplate.editable}" type="radio"></td>

			<td><a href="${ctx}/business/messagetemplate/form?id=${messageTemplate.id}">${messageTemplate.id}</a></td>
			<td>${messageTemplate.name}</td>
			<td>${dic:getLabelByValue(messageTemplate.type, 'tb_message_template_type')}</td>
			<td>${messageTemplate.weChatTemplateId}</td>
			<td>${messageTemplate.templateContent}</td>
			<td>${dic:getLabelByValue(messageTemplate.receive, 'tb_message_template_receive')}</td>
			<td>${messageTemplate.areaId}</td>
			<td>${dic:getLabelByValue(messageTemplate.status, 'tb_message_template_status')}</td>
			<td>${dic:getLabelByValue(messageTemplate.editable, 'tb_message_template_editable')}</td>
			<td>${messageTemplate.remarks}</td>
		</tr>
	</c:forEach>
	</tbody>
</table>
</div>
<div class="pagination">${page}</div>
</body>
</html>